// .txt

beginzonescript;

variables;

short crime_tolerance = 200;
short last_abil;
short i;
short hunt_count = 0;

body;

beginstate INIT_STATE;
	if (gf(56,5) == 2)
		sf(56,5,1);
	sf(56,6,0);

	if (gf(56,7) > 0) {
		set_terrain(15,53,0);
		set_terrain(14,53,13);
		set_terrain(16,53,15);
		}
		
//	set_name(,"");

	add_range_to_group(14,21,1);
	add_range_to_group(22,27,2);

	set_name(27,"Mad Gorov");
	set_boss_level(27,1);
	set_new_abil(27,11);
	set_strategy(27,0);
	set_attack_bonus(27,10);
	bless_char(27,2);

	add_range_to_group(34,38,3);
	set_aggression(1003,9);
	change_max_health(34,100);
	set_level(1003,24);

	add_range_to_group(39,43,4);
	set_aggression(1004,9);
	change_max_health(39,100);
	change_max_health(40,100);
	set_level(1004,24);

	add_range_to_group(44,48,5);
	set_aggression(1005,9);
	change_max_health(44,100);
	set_level(44,24);	
	
	//if (get_sdf() > 0) {
		//make_zone_hostile();
		//}

	last_abil = get_current_tick();
	
	set_crime_tolerance(crime_tolerance);
	break;

beginstate EXIT_STATE;

break;

beginstate START_STATE;
	// clear zone?
	if ((zone_clear(ME) == FALSE) && (gf(56,3) > 1)) {
		print_str_color("You convinced the serviles to let you by.",2);
		print_str_color("It will be easy to pass this area now.",2);
		clear_zone(ME);	
		}
	if ((zone_clear(ME) == FALSE) && (num_chars_in_group(1) == 0)) {
		print_str_color("You have cleared the road.",2);
		print_str_color("It will be easy to pass this area now.",2);
		clear_zone(ME);	
		}
		
	//if ((get_crime_level() >= crime_tolerance) && (get_sdf(,) == 0)) {
	//	make_zone_hostile();
	//	set_flag(,,1);
	//	}

	// if (gf(,) == 0) {
	//	if (get_ran(1,0,100) < 10)
	//		give_char_text_bubble(,"");
	//	}
	
	if (((is_combat()) && (tick_difference(last_abil,get_current_tick()) > 0)) || ((is_group()) && (tick_difference(last_abil,get_current_tick()) > 5))) {
		last_abil = get_current_tick();

		if ((gf(56,5) > 1) && (gf(56,6) == 0) && (num_chars_in_group(1) > 0)) {
			hunt_count = hunt_count + 1;
			if (((hunt_count == 2) && (gf(56,3) == 1)) || ((hunt_count == 9) && (gf(56,3) == 2))) {
				print_str_color("You hear a horn sound. The serviles have begun their hunt.",2);
				sf(56,6,1);
				set_attitude(1001,10);
				}
			}
		}

break;

//beginstate 10;
//break;

//	print_str("");
//	set_terrain_string_range(".",3);
//	set_terrain_string_range("The sign says - .",3);
